package com.wwwarehouse.resource_center.bean.rules;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Joseph on 2017/11/6.
 *         <p/>
 */

public class TaskUnitBean implements Parcelable {


    /**
     * code : 0
     * data : {"list":[{"acitonType":"C","acitonUnitDesc":"创建仓库地图","acitonUnitName":"创建仓库地图","acitonUnitType":"CREATE_STOCK_MAP","acitonUnitUkid":"74042204746880003"},{"acitonType":"C","acitonUnitDesc":"创建库位码","acitonUnitName":"创建库位码","acitonUnitType":"CREATE_STORAGE_CODE","acitonUnitUkid":"52022222524652215"},{"acitonType":"C","acitonUnitDesc":"创建位置码","acitonUnitName":"创建位置码","acitonUnitType":"CREATE_LOCATION_CODE","acitonUnitUkid":"52023323524221115"},{"acitonType":"C","acitonUnitDesc":"定义库存","acitonUnitName":"设置库存类型","acitonUnitType":"INVENTORY_DEFINITION","acitonUnitUkid":"52021102524658991"},{"acitonType":"C","acitonUnitDesc":"编辑任务分配规则","acitonUnitName":"编辑任务分配规则","acitonUnitType":"MODIFY_ASSIGN_TASK_RULE","acitonUnitUkid":"42133200000001000"},{"acitonType":"C","acitonUnitDesc":"新增任务分配规则","acitonUnitName":"新增任务分配规则","acitonUnitType":"ADD_ASSIGN_TASK_RULE","acitonUnitUkid":"42133300000001000"}],"page":1,"size":6,"total":6}
     * msg : 调用成功
     */

    private int code;
    private DataBean data;
    private String msg;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static class DataBean implements Parcelable {
        /**
         * list : [{"acitonType":"C","acitonUnitDesc":"创建仓库地图","acitonUnitName":"创建仓库地图","acitonUnitType":"CREATE_STOCK_MAP","acitonUnitUkid":"74042204746880003"},{"acitonType":"C","acitonUnitDesc":"创建库位码","acitonUnitName":"创建库位码","acitonUnitType":"CREATE_STORAGE_CODE","acitonUnitUkid":"52022222524652215"},{"acitonType":"C","acitonUnitDesc":"创建位置码","acitonUnitName":"创建位置码","acitonUnitType":"CREATE_LOCATION_CODE","acitonUnitUkid":"52023323524221115"},{"acitonType":"C","acitonUnitDesc":"定义库存","acitonUnitName":"设置库存类型","acitonUnitType":"INVENTORY_DEFINITION","acitonUnitUkid":"52021102524658991"},{"acitonType":"C","acitonUnitDesc":"编辑任务分配规则","acitonUnitName":"编辑任务分配规则","acitonUnitType":"MODIFY_ASSIGN_TASK_RULE","acitonUnitUkid":"42133200000001000"},{"acitonType":"C","acitonUnitDesc":"新增任务分配规则","acitonUnitName":"新增任务分配规则","acitonUnitType":"ADD_ASSIGN_TASK_RULE","acitonUnitUkid":"42133300000001000"}]
         * page : 1
         * size : 6
         * total : 6
         */

        private int page;
        private int size;
        private int total;
        private List<ListBean> list;

        public int getPage() {
            return page;
        }

        public void setPage(int page) {
            this.page = page;
        }

        public int getSize() {
            return size;
        }

        public void setSize(int size) {
            this.size = size;
        }

        public int getTotal() {
            return total;
        }

        public void setTotal(int total) {
            this.total = total;
        }

        public List<ListBean> getList() {
            return list;
        }

        public void setList(List<ListBean> list) {
            this.list = list;
        }

        public static class ListBean implements Parcelable {
            /**
             * acitonType : C
             * acitonUnitDesc : 创建仓库地图
             * acitonUnitName : 创建仓库地图
             * acitonUnitType : CREATE_STOCK_MAP
             * acitonUnitUkid : 74042204746880003
             */

            private String acitonType = "";
            private String acitonUnitDesc = "";
            private String acitonUnitName = "";
            private String acitonUnitType = "";
            private String acitonUnitUkid = "";
            private boolean isSelect = false ;

            public boolean isSelect() {
                return isSelect;
            }

            public void setSelect(boolean select) {
                isSelect = select;
            }

            public String getAcitonType() {
                return acitonType;
            }

            public void setAcitonType(String acitonType) {
                this.acitonType = acitonType;
            }

            public String getAcitonUnitDesc() {
                return acitonUnitDesc;
            }

            public void setAcitonUnitDesc(String acitonUnitDesc) {
                this.acitonUnitDesc = acitonUnitDesc;
            }

            public String getAcitonUnitName() {
                return acitonUnitName;
            }

            public void setAcitonUnitName(String acitonUnitName) {
                this.acitonUnitName = acitonUnitName;
            }

            public String getAcitonUnitType() {
                return acitonUnitType;
            }

            public void setAcitonUnitType(String acitonUnitType) {
                this.acitonUnitType = acitonUnitType;
            }

            public String getAcitonUnitUkid() {
                return acitonUnitUkid;
            }

            public void setAcitonUnitUkid(String acitonUnitUkid) {
                this.acitonUnitUkid = acitonUnitUkid;
            }

            public ListBean() {
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(this.acitonType);
                dest.writeString(this.acitonUnitDesc);
                dest.writeString(this.acitonUnitName);
                dest.writeString(this.acitonUnitType);
                dest.writeString(this.acitonUnitUkid);
                dest.writeByte(this.isSelect ? (byte) 1 : (byte) 0);
            }

            protected ListBean(Parcel in) {
                this.acitonType = in.readString();
                this.acitonUnitDesc = in.readString();
                this.acitonUnitName = in.readString();
                this.acitonUnitType = in.readString();
                this.acitonUnitUkid = in.readString();
                this.isSelect = in.readByte() != 0;
            }

            public static final Creator<ListBean> CREATOR = new Creator<ListBean>() {
                @Override
                public ListBean createFromParcel(Parcel source) {
                    return new ListBean(source);
                }

                @Override
                public ListBean[] newArray(int size) {
                    return new ListBean[size];
                }
            };

            @Override
            public boolean equals(Object o) {
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;

                ListBean listBean = (ListBean) o;

                if (isSelect != listBean.isSelect) return false;
                if (acitonType != null ? !acitonType.equals(listBean.acitonType) : listBean.acitonType != null)
                    return false;
                if (acitonUnitDesc != null ? !acitonUnitDesc.equals(listBean.acitonUnitDesc) : listBean.acitonUnitDesc != null)
                    return false;
                if (acitonUnitName != null ? !acitonUnitName.equals(listBean.acitonUnitName) : listBean.acitonUnitName != null)
                    return false;
                if (acitonUnitType != null ? !acitonUnitType.equals(listBean.acitonUnitType) : listBean.acitonUnitType != null)
                    return false;
                return acitonUnitUkid != null ? acitonUnitUkid.equals(listBean.acitonUnitUkid) : listBean.acitonUnitUkid == null;

            }

            @Override
            public int hashCode() {
                int result = acitonType != null ? acitonType.hashCode() : 0;
                result = 31 * result + (acitonUnitDesc != null ? acitonUnitDesc.hashCode() : 0);
                result = 31 * result + (acitonUnitName != null ? acitonUnitName.hashCode() : 0);
                result = 31 * result + (acitonUnitType != null ? acitonUnitType.hashCode() : 0);
                result = 31 * result + (acitonUnitUkid != null ? acitonUnitUkid.hashCode() : 0);
                result = 31 * result + (isSelect ? 1 : 0);
                return result;
            }
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(this.page);
            dest.writeInt(this.size);
            dest.writeInt(this.total);
            dest.writeList(this.list);
        }

        public DataBean() {
        }

        protected DataBean(Parcel in) {
            this.page = in.readInt();
            this.size = in.readInt();
            this.total = in.readInt();
            this.list = new ArrayList<ListBean>();
            in.readList(this.list, ListBean.class.getClassLoader());
        }

        public static final Creator<DataBean> CREATOR = new Creator<DataBean>() {
            @Override
            public DataBean createFromParcel(Parcel source) {
                return new DataBean(source);
            }

            @Override
            public DataBean[] newArray(int size) {
                return new DataBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.code);
        dest.writeParcelable(this.data, flags);
        dest.writeString(this.msg);
    }

    public TaskUnitBean() {
    }

    protected TaskUnitBean(Parcel in) {
        this.code = in.readInt();
        this.data = in.readParcelable(DataBean.class.getClassLoader());
        this.msg = in.readString();
    }

    public static final Parcelable.Creator<TaskUnitBean> CREATOR = new Parcelable.Creator<TaskUnitBean>() {
        @Override
        public TaskUnitBean createFromParcel(Parcel source) {
            return new TaskUnitBean(source);
        }

        @Override
        public TaskUnitBean[] newArray(int size) {
            return new TaskUnitBean[size];
        }
    };
}
